package ru.urfc.portal.ui.client.renderers;

import ru.urfc.portal.ui.client.descriptor.GridField;

import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.dom.client.Element;

public class BooleanRenderer extends SimpleRenderer {
	protected String trueValue;
	protected String falseValue;

	public BooleanRenderer(GridField field, Element element, String trueValue,
			String falseValue) {
		super(field, element);
		this.trueValue = trueValue;
		this.falseValue = falseValue;
	}

	@Override
	public String render(ModelData modelData) {
		Boolean value = field.getValue(modelData);
		return value? trueValue: falseValue;
	}

}
